package com.atguigu.scala.chapter7

/**
 * @author lizikuan
 * @date 2021/5/22 11:27
 */
object $01_ImmutableArray {
  def main(args: Array[String]): Unit = {
    val arr = new Array[Int](5)
    arr(0) = 1
    val arr2 = Array[Int](1,2,3,4,5,6,7)
    println(arr.toList)
    println(arr2.toList)
    val arr3 = arr2.+:(10)
    println(arr3.toList)
    println(arr2.toList)
    val arr4 = arr2.:+(20)
    println(arr4.toList)
    val arr5 = arr2 ++ (Array(11, 2, 3, 4))
    println(arr5.toList)
    val buffer = arr2.toBuffer
    buffer.+=:(20)
    buffer.+=(12)
    println(buffer)
  }
}
